
#include <QAbstractItemView>

class TextureWidget:
    public QAbstractItemView
{

public:

    TextureWidget( QWidget * widget = 0 ) :
        QAbstractItemView( widget )
    {

    }

    QRect visualRect( const QModelIndex & modelIndex ) const;
    void scrollTo( const QModelIndex & /*index*/, QAbstractItemView::ScrollHint ){}
    QModelIndex indexAt(const QPoint &point) const;
    QModelIndex moveCursor(QAbstractItemView::CursorAction,Qt::KeyboardModifiers){ return QModelIndex(); }
    int horizontalOffset() const{ return 0; }
    int verticalOffset() const{ return 0; }
    bool isIndexHidden( const QModelIndex & ) const { return false; }
    void setSelection(const QRect &,QItemSelectionModel::SelectionFlags){}
    QRegion visualRegionForSelection(const QItemSelection &) const{ return QRegion(); }

    void updateGeometries();

protected:

    void paintEvent( QPaintEvent * event );

private:

    QPixmap
        CacheTexture;
};